# -*- coding=utf-8 -*-

# 爆破PNG图片正确的宽/高
import os
import binascii
import struct
crcbp = open('FILENAME', 'rb').read()
for i in range(1024):
    for j in range(1024):
        data = crcbp[12:16] + \
            struct.pack('>i', i) + struct.pack('>i', j)+crcbp[24:29]
        crc32 = binascii.crc32(data) & 0xffffffff
        if crc32 == 0xcbd6df8a:  # 正确的CRC
            print(i, j)
            print('hex', hex(i), hex(j))
